<?php

namespace app\controller\v1\api;

use app\BaseController;
use app\common\Send;
use app\service\PlacardService;
use think\App;
use think\Request;
use app\service\MemberTokenService;
class Wechat extends BaseController
{
    use Send;

    public function __construct(App $app)
    {
        parent::__construct($app);
    }

    public function getToken(Request $request)
    {

        $code = $request->get('code');
        $pid = $request->get('pid');
        $token = (new MemberTokenService($code))->getToken($pid);
        return self::success($token);
    }

    public function qrcodePlacard()
    {
        $placardService = new PlacardService;

        $res = $placardService->createQrcode("bgqrcode");

        return self::success($res);
    }

}
